package com.itheima.pack04;

import java.util.Arrays;

public class Test001 {
    public static void main(String[] args) {
        String s = "annhdn884gyrnkojenHHU7uj";
        char[] array = s.toCharArray(); // 字符串转化为字符数组
        Arrays.sort(array); // 升序排列
        System.out.println(Arrays.toString(array));
        System.out.print("[");
        for (int i = array.length - 1; i >= 0; i--) {
            if (i == 0) {
                System.out.println(array[i] + "]");
                break;
            }
            System.out.print(array[i] + ", ");
        }
    }
}
